The present invention concerns a method and a system for data transmission and control. More particularly, it concerns a method and a system for data transmission and control based on Universal Serial Bus (USB).
USB, abbreviated from Universal Serial Bus, is a free data transmission specification which transfers data in USB format and is brought forward together by Compaq, DEC, IBM, Intel, Microsoft, NEC, Northern Telecom and etc to simplify the interconnection between PC and peripheral devices. In order to transfer data between devices with CPU therein under the USB format, some software in accordance with USB specification should be installed into the devices which should be coupled with each other via a USB cable to be an USB system. Generally speaking, a USB system comprises three parts: USB host (called USB Master device hereafter in this description), USB device (called USB Slave device or USB function hereafter in this description) and USB interconnection between USB host and USB devices (simply called USB cable or USB connection in this description). USB Master device is coupled with USB Slave device via USB cable. Some software is installed into USB Master device while there is some device configuration information in USB Slave device. After turned on, USB Master device provides power to USB Slave device via a power line in the USB cable. A pulse signal, which is produced by a pull-up resistor, returns to USB Master device through USB cable to inform the existence of USB Slave device to USB Master device and then USB Master device assigns an unique address to USB Slave device. The address is marked by an address register in USB Master device to make sure that corresponding data packets from USB Master device will not be transferred to other USB Slave devices. Meanwhile, a message channel called “ENDPOINT 0” is created between USB Master processor and USB Slave device at first, and then USB Master processor starts to read the device configuration tag word stored in the ROM of USB Slave device through the ENDPOINT 0. The device configuration tag word comprises the device configuration information of USB Slave device. Based on the device configuration tag word, USB Master processor assigns a configuration value to USB Slave device, and then USB Slave device becomes configured. Thus a communication relation is set up between USB Master processor and USB Slave device. The process of setting up a communication relation between the USB Master processor and the Slave device is called “USB Enumeration”. In any USB system, there is only one USB Master device, while USB Slave device can be in number from 1 to 127. Under circumstance of lots of Slave devices, USB Master device and USB Slave devices can be coupled with each other by USB hubs and USB cables.
It should be noted that the word “couple” mentioned above should not be limited to the meaning of coupling through a direct connection of a cable. For example, “UNIT A couples in UNIT B” could not be limited to a coupling in which the output of the UNIT A connects directly to the input of the UNIT B. What it means is that there is a channel between the UNIT A and the UNIT B, and the channel may comprise other devices or other parts.
FIG. 1 is a circuit frame diagram of a conventional USB system. This USB system comprises a USB Master device 131 and a Slave device 132 coupled with each other by a USB cable 121 wherein a communication relation was established. In FIG. 1, USB Master device 131 comprises a USB Master processor 111 and a Data Consumer 114. USB Slave device 132 comprises a USB Slave processor 112 and a Data Storage 115. USB Master processor 111 could be coupled with other Slave devices via USB cable 124. When the system works, USB Master device 131 sends a command to USB Slave processor 112 through USB Master processor 111. And USB Slave processor 112 reads from or writes to the storage system in response to the command, and then transfers the resulting data to USB Master processor 111 which processes the data and then transfers it to the Data Consumer 114 for use.
FIG. 2 is a circuit frame diagram of another conventional USB system. USB Master device 331 of the USB system is a DVD player with a USB Master processor 311 and its Data Consumer 314 comprises a video/audio processor for video/audio decoding. USB Slave device 332 is a static Card Reader comprising a USB Slave processor 312 which could control Data Storage 315. Data Storage 315 could be selected from many storage media such as Smart Media, Memory Stick, Compact Flash, SD card, etc. DVD player 331 couples with Card Reader 332 via USB cable 321. DVD player 331 may also establish communication relations with other USB Slave processor devices via the USB cable 324.
In the USB system, the data transmission between USB Master device and USB Slave device is a synchronous transmission which speed is several fold decuple to the speed of the normal serial port transmission (RS232). The USB Specification supports “Hot Plug-unplug” with regard to connection between USB Master device and USB Slave device, and when coupled with USB Master device, USB Slave device can obtain power from USB Master device directly. The USB data transmission in the full speed can reach the speed of 12 Mb/s, which is hundredfold to the speed of RS232 transmission. According to USB specification 2.0, the speed of USB data transmission can reach to 480 Mb/s. As USB specification 2.0 comes into application in state, a variety of storage devices with USB interface have been developed too fast and too many to see. USB hard disk with the speed of 480 Mb/s according to USB specification 2.0 makes a breakthrough in speed bottleneck and become focus of eyes as Portable Disc-carving machine and flash memory become acceptable for the improvement of speed. That makes real-time transmission of high-discriminating, color-real large figure possible. But the limitation for conventional USB systems is that data can only be transferred from the storage of USB Slave device to the USB Master processor to be processed and then provided to the Data Consumer of the USB Master device for use. This function is comparatively simple.